package name.huzhenbo.java.patterns.command;

class Rover {
    static final RoverState SOUTH_STATE = new RoverSouth();
    static final RoverState WEST_STATE = new RoverWest();
    static final RoverState NORTH_STATE = new RoverNorth();
    static final RoverState EAST_STATE = new RoverEast();

    private int x;
    private int y;
    private RoverState roverState;

    Rover(int x, int y, RoverState roverState) {
        this.x = x;
        this.y = y;
        this.roverState = roverState;
    }

    RoverState getRoverState() {
        return roverState;
    }

    void setSouthState() {
        roverState = SOUTH_STATE;
    }

    void setNorthState() {
        roverState = NORTH_STATE;
    }

    void setWestState() {
        roverState = WEST_STATE;
    }

    void setEastState() {
        roverState = EAST_STATE;
    }

    int getX() {
        return x;
    }

    int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void setX(int x) {
        this.x = x;
    }
}
